<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="UTF-8">
		<title>课工场论坛列表</title>
		<link href="css/bbs.css" rel="stylesheet">
		<script type="text/javascript">
			function fa() {
				var d = document.getElementById("ddd")
				d.style.display = "block"
			}

			function xx() {
				var d = document.getElementById("ddd")
				d.style.display = "none"
			}
			var i=0;
			function xx1() {
				var date = new Date();
				var year = date.getFullYear();
				var month = date.getMonth() + 1;
				var date1 = date.getDate();
				var hour = date.getHours();
				var minute = date.getMinutes();
				var sj=year+"-"+month+"-"+date1+"&nbsp;"+hour+":"+minute
				var div=document.createElement("div")
				var t=document.getElementById("ddd1")
				var bk=document.getElementById("bk")
				div.style.borderBottom="1px #999999 dashed"
				div.style.width="602px"
				div.style.margin="0px 384px"
				div.innerHTML="<p id='p1'>&nbsp;<span id='ps' class='ps'></span></p><img src='img/tou0"+parseInt(Math.random()*4+1)+".jpg' /><span id='sp' class='sp'></span><p id='p1'>&nbsp;</p>"
				div.id="ddv"
				document.getElementById("postList").appendChild(div)
				var sp=document.getElementById("sp")
				var ps=document.getElementById("ps")
				ps.innerHTML=t.value
				sp.innerHTML="版块："+bk.value+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发表时间："+sj
				var d = document.getElementById("ddd")
				d.style.display = "none"
				sp.id="i"
				ps.id="i"
				i++;
			}
		</script>
	</head>
	<body>
		<div class="bbs">
			<header><span onclick="fa()">我要发帖</span></header>
			<section>
				<ul id="postList">
					<li>
						<div><img src="img/tou02.jpg"></div>
						<h1>ggggg</h1>
						<p><span>版块：新手报到</span><span>发表时间：2019-11-18 17:28</span></p>
					</li>
					<li>
						<div>
							<img src="img/tou01.jpg"></div>
						<h1>ddddd</h1>
						<p><span>版块：新课来了</span><span>发表时间：2019-11-18 17:27</span></p>
					</li>
				</ul>
			</section>
		</div>
		<div id="ddd">
			<input type="text" id="ddd1" placeholder="请输入标题 (1-50个字符)" />
			<p id="ddd2">
				<label for="bk">所属板块：</label>
				<select id="bk">
					<option style='display: none'>请选择板块</option>
					<option>电子书籍</option>
					<option>新课来了</option>
					<option>新手报到</option>
					<option>职业规划</option>
				</select>
			</p>
			<textarea id="wb"></textarea>
			<input type="button" id="fb" value="发布" onclick="xx1()"/>
			<input type="button" id="xx1" onclick="xx()" value="X"/>
		</div>
	</body>
</html>
